﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoginAndRegister.aspx.cs" Inherits="Messages.LoginAndRegister" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="res/jquery.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Button ID="Login" Text="click" runat="server" />
            <asp:Label ID="UserName" Text="" runat="server" />
        </div>
    </form>

    <script type="text/javascript">
    // 文档加载
    $(document).ready(function () {
        // 绑定事件
        $("#Login").bind("click", CofirmUser);
    })

    function CofirmUser() {
        $.ajax({
            type: "post",
            url: "LoginAndRegister.aspx/CofirmUser",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
                alert("调用成功！");
            },
            error: function (err) {
                alert("产生错误！");
            }
        });
    }
</script>
</body>
</html>
